// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

/*引入ElementUI*/
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

// 引入echarts
import echarts from 'echarts';

Vue.prototype.$echarts = echarts;

//二次封装axios
import http from './http'

Vue.prototype.$http = http;

/*md5*/
import md5 from 'js-md5';

Vue.prototype.$md5 = md5;

Vue.config.productionTip = false;


/*router.beforeEach((to, from, next) => {
  const role = localStorage.getItem('ms_username');
  if (!role && to.path !== '/login') {
    next('/login');
  } else {
    next();
  }
});*/


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: {App},
  template: '<App/>'
});
